class smx_worker
{
  require smx_os
  require smx_download
  require smx_java
  file { '/etc/init.d/fxworker':
    ensure => file,
    owner  => root, group => root, mode => 755,
    source => 'puppet:///modules/smx_worker/fxworker',
  }

  service { 'fxworker':
    ensure    => running,
    enable    => true,
    path      => "/etc/init.d",
    start     => "/etc/init.d/fxworker start",
    stop      => "/etc/init.d/fxworker stop",
    subscribe => File["/etc/init.d/fxworker"],
    require   => File['/etc/init.d/fxworker'],
  }

  file { '/usr/local/bin/monitor_worker.sh':
    ensure  => file,
    owner   => root, group => root, mode => 755,
    content => template('smx_worker/monitor_worker.sh.erb'),
    #      before => Cron['monitor'],
  }

  #   cron { monitor:
  #      command => "/usr/local/bin/monitor_worker.sh",
  #      user => root,
  #      minute => 0,
  #      require => File['/etc/init.d/fxworker'],
  #   }

}
